#include "front.h"#include "manager.h"
front::front(){}
front::~front(){
}
void front::setFd(int fd){
	netfd = fd;}
void front::setManager(manager *m ){
	boss = m;}

void front::input(){
	printf("front input\n");
	int len = ::recv(netfd, buffer, 10240, 0);
	if( len == 0 ){
		boss->closeConn();
		return ;
	}else if (len < 0){
		printf("recv error\n");
		return ;
	}else if( len > 0 ){
		printf("msg:%s\n", buffer);
		boss->sendToBack(buffer, len);	}}
void front::output(){
}int front::send(const char* msg, int msg_len){	printf("front::send\n");	int ret = ::send(netfd, msg, msg_len, 0);	return ret;}
void front::timeout(){}
void front::close(){	::close(netfd);}

